/*********************\
* Author:Dzlua
* QQ:505544956
* Time:2017/04/15
\**********************/
#include "LuaIPAddress.h"

#define CObjPtr ((CIPAddressUI*)m_cobj)

namespace DuiLib {

DWORD LuaIPAddress::GetIP()
{
    return CObjPtr->GetIP();
}

void LuaIPAddress::SetIP(DWORD dwIP)
{
    CObjPtr->SetIP(dwIP);
}

void LuaIPAddress::SetReadOnly(bool bReadOnly)
{
    CObjPtr->SetReadOnly(bReadOnly);
}

bool LuaIPAddress::IsReadOnly()
{
    return CObjPtr->IsReadOnly();
}

void LuaIPAddress::UpdateText()
{
    CObjPtr->UpdateText();
}

SDLUA_BEGIN_REGISTER(LuaIPAddress, IPAddress, Label)
    SDLUA_REGISTER_FUN_CPP(LuaIPAddress, GetIP, GetIP)
    SDLUA_REGISTER_FUN_CPP(LuaIPAddress, SetIP, SetIP)
    SDLUA_REGISTER_FUN_CPP(LuaIPAddress, SetReadOnly, SetReadOnly)
    SDLUA_REGISTER_FUN_CPP(LuaIPAddress, IsReadOnly, IsReadOnly)
    SDLUA_REGISTER_FUN_CPP(LuaIPAddress, UpdateText, UpdateText)
SDLUA_END_REGISTER

SDLUA_BEGIN_UNREGISTER(LuaIPAddress, IPAddress)
SDLUA_END_UNREGISTER(IPAddress)

}

#undef CObjPtr